Activity: Point of user interaction with the application, most commonly through a UI screen or window
Broadcast Receiver: Listens for and receives messages from
applications and the Android system
Content Provider: Application data storage (SQLite databases)
Service: Operates in the background to provide long-running
application functionality without user interaction
Parameters: Look for putExtra(key, value), get*Extra(key) or getData() to see what parameters are taken from a Android Intent. Look for getQueryParameter for parameters names.
These Activities must be declared in the Manifest file. These are the UI views that can be shown to the user. The start funciton of the app is a Activity that can be called by any application. This is how a homescreen opens the app when the icon is pressed.
Activity Lifecycle:
onCreate(): When the Activity Starts this function is called.
onStart(): When the Activity Starts this function is called after onCreate(). This is run when the activity is shown to the user.
onResume(): This is called when the Activity is foregrounded after onStart(). This is also called when the app is running but switches from another Activity.
onPause(): This is run when the Application starts another activity, switches to another application, when receiving a phone call, or the device screen’s turning off.
onStop(): This occurs when the a new activity covers the entire screen or when the activity has finished running.
onDestroy(): This occurs after the onStop callback.
android:exported
If set to true this Activity be launched by another application.
If this has an intent-filter in it then it is exported by default
If set to false can only be launched by components of the same application or the same user ID. This is the default value.
dz> run app.activity.start --component com.cisco.webex.meetings com.cisco.webex.meetings.ui.premeeting.welcome.WebExMeetingdz> run app.activity.start --component com.cisco.webex.meetings com.cisco.webex.meetings.ui.integration.AssistantActivitydz> run app.activity.start --component com.example.app.client com.example.app.client.ui.SettingsActivity --extra string Uri "file:///sdcard/Download/nm_settings.json"
Start an Activity from the commandline:
am start -n com.example.app.client/.ui.SettingsActivity -a android.intent.action.VIEW -d file:///sdcard/Download/nm_settings.jsonam start -n com.example.app.client/.ui.ImportUserCertificateActivity -a android.intent.action.VIEW -d file:///sdcard/Download/crt.p12 --eu Password test --ez Standalone Trueadb shell am start -n com.quora.android/com.quora.android.ModalContentActivity -e url 'http://test/test' -e html '<script>alert(QuoraAndroid.getClipboardData());</script>'
Enable applications to receive messages/triggers that are broadcast by the system or by other applications,
This can happen when the application is not running.
Example getting a text message, incoming call, or a notification
Can be created in the Manifest file or by Code.
This information is not secret since it can be listened to by other applications on the device
android:exported
If set to true this Receiver can receive intents from other applications. This is the default value if their are intent filters.
If set to false can only be launched by components of the same application or the same user ID. This is the default value if their are no intent filters.
If set to true this Activity be launched by another application. This is the default value if their are intent filters.
If set to false can only be launched by components of the same application or the same user ID. This is the default value if their are no intent filters.
android:permission
specifies if the caller needs a specific permission to launch the service. By default the service is not protected by a permission.